<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <script src="../0_assets/vue2.js"></script>
</head>

<body>
    <div id="app">
        <h6>{{ text }}</h6>
        <!-- 
            v-model的修饰符
                .lazy: 懒惰更新，只有当输入框失去焦点或者按下enter键时绑定的数据才会更新
                .number: 将输入框中的内容转为数字类型
                .trim: 过滤掉输入框中内容左右两边的空格
         -->
        <div>
            {{ text }}
            <input type="text" v-model.lazy="text"/>
        </div>
        <div>
            {{ typeof number }} &nbsp; {{ number }}
            <input type="text" v-model.number="number"/>
        </div>
    </div>
    <script>
        let app = new Vue({
            el: '#app',
            data(){
                return {
                    text:'',
                    number:''
                }
            },
        });
    </script>
</body>

</html>